/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.web.mapper;

import com.jeeplus.core.persistence.BaseMapper;
import com.jeeplus.core.persistence.annotation.MyBatisMapper;
import com.jeeplus.modules.web.entity.WxCouponType;
import com.jeeplus.modules.web.entity.WxUser;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 优惠券类型MAPPER接口
 * @author rongjie
 * @version 2017-08-06
 */
@MyBatisMapper
public interface WxCouponTypeMapper extends BaseMapper<WxCouponType> {
    /***
     * 获取优惠卷号
     * @param equipment
     * @return
     */
    @Select("select coupon_type_id from  yj_equipment where number=#{equipment}")
    String getEquipment(String equipment);

    @Select("select coupon_total from  wx_order where order_number=#{number}")
    Integer getCouponTotal(String number);

    @Update("update    wx_order set  coupon_total=(coupon_total+1) where order_number=#{number}")
    void setCouponTotal(String number);

}